package com.kaibes.web.prefix;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;

@Component
public class PrefixStartedListener implements ApplicationListener<ContextRefreshedEvent> {
    
    @Autowired
    private PrefixHandler prefixHandler;
    @Autowired
    private RequestMappingHandlerAdapter adapter;
    
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        prefixHandler.init(adapter);
    }
    
}
